<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="vue.js"></script>
  </head>
  <body>
    <div id="root">
      <my-content-one>
        <template slot-scope="list">
          <li>{{ list.item }}</li>
          <!-- <h1>{{ list.item }}</h1> -->
        </template>
      </my-content-one>
    </div>
    <script>
      Vue.component('my-content-one', {
        template: `<div>
                    <slot v-for="item of list" :item=item>没有使用插槽则使用默认值</slot>
                   </div>`,
        data() {
          return {
            list: [1, 2, 3, 4, 5]
          };
        }
      });

      var vim = new Vue({
        el: '#root'
      });
      // 外部组件控制循环使用到的元素
    </script>
  </body>
</html>
